package com.dragon.modules.yuegou.query.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.system.EventActionEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 事件与动作表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-11-27 16:22:05
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class EventActionQuery extends EventActionEntity implements Query<EventActionEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 事件名称查询条件 */
	@JsonUnwrapped(prefix = "eventKey")
	private Condition<String> eventKeyCondition;

    /** 动作名称查询条件 */
	@JsonUnwrapped(prefix = "actionName")
	private Condition<String> actionNameCondition;

    /** 是否删除（1：已删除，0：未删除）查询条件 */
	@JsonUnwrapped(prefix = "del")
	private Condition<Boolean> delCondition;

    /** 删除时间查询条件 */
	@JsonUnwrapped(prefix = "delTime")
	private Condition<LocalDateTime> delTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public EventActionQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public EventActionQuery(EventActionEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public EventActionQuery(EventActionQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.eventKeyCondition != null) {
			this.eventKeyCondition = other.eventKeyCondition.copy();
		}
		if(other.actionNameCondition != null) {
			this.actionNameCondition = other.actionNameCondition.copy();
		}
		if(other.delCondition != null) {
			this.delCondition = other.delCondition.copy();
		}
		if(other.delTimeCondition != null) {
			this.delTimeCondition = other.delTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<EventActionEntity> toQueryWrapper() {
		QueryWrapper<EventActionEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (eventKeyCondition != null) {
			eventKeyCondition.toWrapper(wrapper, COL_EVENT_KEY);
		}
		if (actionNameCondition != null) {
			actionNameCondition.toWrapper(wrapper, COL_ACTION_NAME);
		}
		if (delCondition != null) {
			delCondition.toWrapper(wrapper, COL_DEL);
		}
		if (delTimeCondition != null) {
			delTimeCondition.toWrapper(wrapper, COL_DEL_TIME);
		}
		return wrapper;
	}
	
	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回事件名称查询条件
	 * 
	 * @return eventKeyCondition 事件名称查询条件
	 */
	public Condition<String> eventKey() {
		this.eventKeyCondition = new Condition<>();
		return this.eventKeyCondition;
	}
	
	/**
	 * 获取事件名称查询条件
	 * 
	 * @return eventKeyCondition 事件名称查询条件
	 */
	public Condition<String> getEventKeyCondition() {
		return eventKeyCondition;
	}

	/**
	 * 设置事件名称查询条件
	 * 
	 * @param eventKeyCondition 事件名称查询条件
	 */
	public void setEventKeyCondition(Condition<String> eventKeyCondition) {
		this.eventKeyCondition = eventKeyCondition;
	}

	/**
	 * 构造并返回动作名称查询条件
	 * 
	 * @return actionNameCondition 动作名称查询条件
	 */
	public Condition<String> actionName() {
		this.actionNameCondition = new Condition<>();
		return this.actionNameCondition;
	}
	
	/**
	 * 获取动作名称查询条件
	 * 
	 * @return actionNameCondition 动作名称查询条件
	 */
	public Condition<String> getActionNameCondition() {
		return actionNameCondition;
	}

	/**
	 * 设置动作名称查询条件
	 * 
	 * @param actionNameCondition 动作名称查询条件
	 */
	public void setActionNameCondition(Condition<String> actionNameCondition) {
		this.actionNameCondition = actionNameCondition;
	}

	/**
	 * 构造并返回是否删除（1：已删除，0：未删除）查询条件
	 * 
	 * @return delCondition 是否删除（1：已删除，0：未删除）查询条件
	 */
	public Condition<Boolean> del() {
		this.delCondition = new Condition<>();
		return this.delCondition;
	}
	
	/**
	 * 获取是否删除（1：已删除，0：未删除）查询条件
	 * 
	 * @return delCondition 是否删除（1：已删除，0：未删除）查询条件
	 */
	public Condition<Boolean> getDelCondition() {
		return delCondition;
	}

	/**
	 * 设置是否删除（1：已删除，0：未删除）查询条件
	 * 
	 * @param delCondition 是否删除（1：已删除，0：未删除）查询条件
	 */
	public void setDelCondition(Condition<Boolean> delCondition) {
		this.delCondition = delCondition;
	}

	/**
	 * 构造并返回删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> delTime() {
		this.delTimeCondition = new Condition<>();
		return this.delTimeCondition;
	}
	
	/**
	 * 获取删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> getDelTimeCondition() {
		return delTimeCondition;
	}

	/**
	 * 设置删除时间查询条件
	 * 
	 * @param delTimeCondition 删除时间查询条件
	 */
	public void setDelTimeCondition(Condition<LocalDateTime> delTimeCondition) {
		this.delTimeCondition = delTimeCondition;
	}

}
